<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title></title>
	</head>
	<body>
		<input type="checkbox" id="ck" />
		<hr />
		<div id="div">
			<input type="checkbox"/><br />
			<input type="checkbox" /><br />
			<input type="checkbox" /><br />
			<input type="checkbox" /><br />
			<input type="checkbox" />
		</div>
        <script type="text/javascript">
        document.getElementById('ck').onclick = function () {
        let oDiv = document.getElementById('div');
        let arrInputs = oDiv.children;
        for (let i = 0; i < arrInputs.length; i++) {
            let oInput = arrInputs[i];
            oInput.checked=this.checked;
        }
    }
        </script>
	</body>
</html>